
<template>
    <div class="contentBox">
        <searchTop :isBottmNavigation="false"></searchTop>
        <banner :bannerList="bannerList"></banner>
        <list :data="tableData"></list>
    </div>
</template>
  
<script lang="ts" setup>
import { ref, reactive } from "vue";
import { useRoute } from "vue-router";
import searchTop from "../../../components/searchTop.vue"; //搜索组件
import banner from "./banner.vue"
import list from "./list.vue"
import { ProductgetIndexTypeProduct,comgetAd } from "../../../utils/api"

const route = useRoute()
const typeID = route.query.typeID
console.log(typeID,'typeID');


// banner
const bannerList = ref([])
comgetAd({type:0,type_id:typeID}).then(res=>{
    console.log(res,'banner');
    bannerList.value  = res.data
})
// 列表
const tableData = ref([
])
let params = {limit:24,page:1,type_id:typeID}
ProductgetIndexTypeProduct(params).then(res=>{
    tableData.value = res.data.data
})


</script>
  
  
<style scoped>
.contentBox {
    max-width: 1920px;
    margin: 0 auto;
    background: #f5f5f5;
}
</style>
  